if (!jsx3.lang.Class.forName("ux.cdb.admin.receiptPkg.SelectModelDlg")) {
/**
 * Define the <code>tibco.spm.design.rule.builder.Builder</code> class.
 * This class inherit from <code>jsx3.gui.Dialog<code> GUI class.
 */
jsx3.Class.defineClass(
		"ux.cdb.admin.receiptPkg.SelectModelDlg",
		jsx3.gui.Dialog,
		null,
		function (objRoot) {
			/**
			 * This method will be called after UI file has deserialized.
			 */

			objRoot.prototype.onAfterDeserialize = function(isBankMode) {
				this.isBankMode = isBankMode;
				if(this.isBankMode == "receipt"){
					this.getDescendantOfName("blockRole").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
				}else if(this.isBankMode == "approve"){
					this.getDescendantOfName("blockBankRole").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
				}
			}

			objRoot.prototype.selectMain = function() {
				this.getDescendantOfName("radioCountryDuty").setGroupValue("countryDuty", true);
				this.getDescendantOfName("radioCountryDuty").setEnabled(jsx3.gui.Form.STATEENABLED, true);
				this.getDescendantOfName("radioProvTrans").setEnabled(jsx3.gui.Form.STATEENABLED, true);
				this.getDescendantOfName("radioProvDuty").setEnabled(jsx3.gui.Form.STATEENABLED, true);
			}

			objRoot.prototype.selectNoMain = function() {
				this.getDescendantOfName("radioCountryDuty").setGroupValue("countryDuty", true);
				this.getDescendantOfName("radioCountryDuty").setEnabled(jsx3.gui.Form.STATEENABLED, true);
				this.getDescendantOfName("radioProvTrans").setEnabled(jsx3.gui.Form.STATEDISABLED, true);
				this.getDescendantOfName("radioProvDuty").setEnabled(jsx3.gui.Form.STATEDISABLED, true);
			}

			objRoot.prototype.onSubmit = function() {
				if(this.getDescendantOfName("radioMainMode").getGroupValue() == "true"){
					this.opener.isMainMode = true;
				}else{
					this.opener.isMainMode = false;					
				}

				if(this.isBankMode == "receipt"){
					this.opener.userRole = this.getDescendantOfName("radioCountryDuty").getGroupValue();
				}else if(this.isBankMode == "approve"){
					this.opener.userRole = this.getDescendantOfName("radioBankTransactor").getGroupValue();
				}
				this.doClose();
				this.opener.onSelectMode();
			}
			
		});
}